<template>
  <div class="hello">
    <h1>东软云医院HIS系统--费用科目表</h1>
    <h2>开发人员:于海洋</h2>

    <el-table :data="msg" style="width: 100%">
      <!-- 查询用户 -->
          <el-table-column prop="expCode" label="科目编码" width="180"></el-table-column>
          <el-table-column prop="expName"  label="科目名称"   width="180"></el-table-column>
          <el-table-column label="操作">
              <template slot-scope="scope">
                  <el-button @click="getIdClick(scope.$index, scope.row)">发送ID</el-button>
                   <el-button @click="handleDelete(scope.$index, scope.row)">删除</el-button>
              </template>
          </el-table-column>
     </el-table>
    <el-button @click="submitClick">欢迎测试！</el-button>

    <!-- Dialog 新增结算类别-->
       <!-- <el-dialog title="新增费用科目" :visible.sync="dialogFormVisible_add" :close-on-click-modal="false" @closed="selectInfo()">
          <el-form :model="addPage">
            <el-form-item label="科目编码" :label-width="LabelWidth">
              <el-input v-model="addPage.expCode" autocomplete="off"></el-input>
            </el-form-item>
            <el-form-item label="科目名称" :label-width="LabelWidth">
              <el-input v-model="addPage.expName" autocomplete="off"></el-input>
            </el-form-item>
          </el-form>
          <div slot="footer" class="dialog-footer">
            <el-button @click="dialogFormVisible_add = false">取 消</el-button>
            <el-button type="primary" @click="doAddSettleCategory()">保 存</el-button>
          </div>
       </el-dialog> -->

   </div>
</template>

<script>
export default {
  name: 'ExpenseClass',
  data () {
    return {
      msg: [
        {
          expCode:'WWE',
          expName:'终极格斗'
        }
      ]
    }
  },
  methods:{
   /* 查询用户 */
     submitClick(){
        let _this = this;
        alert("您好，欢迎进行测试！")
        this.$axios.get("/neusys/user/queryAllExpense")
        .then(response =>{
        _this.msg = response.data;
        })
      },
      getIdClick(index, row){
        let _this = this;
        this.$axios
        .get("/neusys/user/updateExpense",{
          params:{
            id:1,
            expName:this.msg[index].expName
          }
        })
        .then(response=>{
          alert("OK");
        })
      },
       handleDelete(index, row) {
         alert(index, row);
      }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h1, h2 {
  font-weight: normal;
}
ul {
  list-style-type: none;
  padding: 0;
}
li {
  display: inline-block;
  margin: 0 10px;
}
a {
  color: #42b983;
}
</style>
